package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jdk.jfr.DataAmount;
import lombok.Data;

import java.util.List;

/**
 * 用户类
 */

@Data
@ApiModel(value = "用户类")
@TableName("t_user")
public class UserBean {
    /*
    （用户编号，用户名，密码(默认值为“666”)，真实姓名，角色集合，权限集合）
     */
    @ApiModelProperty(hidden = true)
    @TableId(value = "pk_userId",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "用户名")
    @TableField("u_username")
    private String username;
    @ApiModelProperty(value = "密码")
    @TableField("u_password")
    private String password;
    @ApiModelProperty(value = "真实姓名")
    @TableField("u_realName")
    private String realName;
    @ApiModelProperty(value = "角色集合")
    @TableField(exist = false)
    private List<RoleBean> roleList;
    @ApiModelProperty(value = "权限集合")
    @TableField(exist = false)
    private List<GradeBean> gradeList;

    public UserBean() {
    }

    public UserBean(String username, String password, String realName) {
        this.username = username;
        this.password = password;
        this.realName = realName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public List<RoleBean> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<RoleBean> roleList) {
        this.roleList = roleList;
    }

    public List<GradeBean> getGradeList() {
        return gradeList;
    }

    public void setGradeList(List<GradeBean> gradeList) {
        this.gradeList = gradeList;
    }

    @Override
    public String toString() {
        return "\nUserBean{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", realName='" + realName + '\'' +
                ", roleList=" + roleList +
                ", gradeList=" + gradeList +
                '}';
    }
}
